<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>

</body>
<script type="text/javascript">
    var num = prompt("输入数字：");
    num % 2 == 0 ? console.log('偶数') : console.log('奇数');

    console.log(num % 2 == 0 ? '偶数' : '奇数');

    
</script>

</html>